var WxSearch = require('../../wxSearch/wxSearch.js')
Page({
  data: {
    imgUrls: [
      '../../image/index.jpg',
      '../../image/index2.jpg',
      '../../image/index3.jpg',
      '../../image/index4.jpg',
    ],
    indicatorDots:true,
    autoplay: true,
    interval: 5000,
    duration: 1000,
    Xiangmu:{},
    hotList:[
      {
        pic:"../../image/index.jpg",
        title:"鑫鑫楼盘",
        area:"湖北",
        day:"武汉",
        fee:"双臣房源",
        id:1
      },
      {
        pic:"../../image/index4.jpg",
        title:"旅行花园",
        area: "湖北",
        day: "武汉",
        fee: "双臣房源",
        id: 2
      },
      {
        pic:"../../image/index4.jpg",
        title:"彩虹的梦",
        area: "湖北",
        day: "武汉",
        fee: "双臣房源",
        id: 3
      },
      {
        pic:"../../image/index4.jpg",
        title:"日暮三亚",
        area: "湖北",
        day: "武汉",
        fee: "双臣房源",
        id: 4
      },
      {
        pic:"../../image/index4.jpg",
        title:"尔夫花园",
        area: "湖北",
        day: "武汉",
        fee: "双臣房源",
        id: 5
      },
      {
        pic:"../../image/index4.jpg",
        title:"西岛恋曲",
        area:"三亚",
        day:"1day",
        id: 6,
        fee: "双臣房源",
       
      }
    ],
  },
  onLoad:function(){
    console.log("初始化")
    var thispage = this;
    wx.request({
      url: 'http://localhost:8080/selectItemsAllInfo',
      //
      data: {
        
      },
      method: 'GET',
      header: {
        'content-type': 'application/json' // 默认值
      },
      success: function (res) {
        
       console.log(res)
    console.log(res.data[0])
    console.log(res.data[1])
    
    thispage.setData({Xiangmu:res.data})
        
      },
      complete: function (res) {


       
      }
    });

  },

yuyue: function(e) {
  console.log(e.currentTarget.dataset);
  console.log("id传值"+e.currentTarget.dataset.id);
  console.log(e.currentTarget.dataset.name);
  wx.setStorage({
    key:"ipic",
    data:e.currentTarget.dataset.pic
  });
  wx.setStorage({
    key:"iname",
    data:e.currentTarget.dataset.name
  });
  wx.setStorage({
    key:"iid",
    data:e.currentTarget.dataset.id
  });
  wx.setStorage({
    key:"idesc",
    data:e.currentTarget.dataset.desc
  });
  wx.setStorage({
    key:"ideat",
    data:e.currentTarget.dataset.deat
  });
 
    wx.navigateTo({
      url: '../xiangqing/xiangqing'
    });

},
more: function(){
  
  wx.navigateTo({
    url:'../more/more'
  })
},
  changeIndicatorDots: function(e) {
    this.setData({
      indicatorDots: !this.data.indicatorDots
    })
  },
  changeAutoplay: function(e) {
    this.setData({
      autoplay: !this.data.autoplay
    })
  },
  intervalChange: function(e) {
    this.setData({
      interval: e.detail.value
    })
  },
  durationChange: function(e) {
    this.setData({
      duration: e.detail.value
    })
  },
  upper: function(e) {
    console.log(e)
  },
  lower: function(e) {
    console.log(e)
  },
  scroll: function(e) {
    console.log(e)
  },
  tap: function(e) {
    for (var i = 0; i < order.length; ++i) {
      if (order[i] === this.data.toView) {
        this.setData({
          toView: order[i + 1]
        })
        break
      }
    }
  },
  tapMove: function(e) {
    this.setData({
      scrollTop: this.data.scrollTop + 10
    })
  }
})
